﻿using System;
using Castle.ActiveRecord;
using CosyTrade.Data;
using CosyTrade.Futures;

namespace CosyTrade.Futures
{
    /// <summary>
    /// 付款信息
    /// </summary>
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tbPayInfo"), Serializable]
    public class PayInfo : BusinessObject 
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access = PropertyAccess.NosetterCamelcase)]
        public override Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        /// <summary>
        /// 支票号
        /// </summary>
        private string payCode;
        /// <summary>
        /// 付款日期
        /// </summary>
        private DateTime payDate = DateTime.Now.AddMonths(1);
        /// <summary>
        /// 付款人
        /// </summary>
        private string payer;
        /// <summary>
        /// 收款人
        /// </summary>
        private string getPayer;
        /// <summary>
        /// 收款金额
        /// </summary>
        private double money;
        /// <summary>
        /// 付款状态
        /// </summary>
        private bool paystate = true;
        /// <summary>
        /// 付款方式
        /// </summary>
        private PayMethod paymethod = PayMethod.Cash;
        /// <summary>
        /// 订单ID
        /// </summary>
        private Guid orderGuid;
        
        /// <summary>
        /// 支票号
        /// </summary>
        [Property]
        public string PayCode
        {
            get { return payCode; }
            set { payCode = value; }
        }

        /// <summary>
        /// 付款日期
        /// </summary>
        [Property]
        public DateTime PayDate
        {
            get { return payDate; }
            set { payDate = value; }
        }

        /// <summary>
        /// 付款人
        /// </summary>
        [Property]
        public string Payer
        {
            get { return payer; }
            set { payer = value; }
        }

        /// <summary>
        /// 收款人
        /// </summary>
        [Property]
        public string GetPayer
        {
            get { return getPayer; }
            set { getPayer = value; }
        }

        /// <summary>
        /// 收款金额
        /// </summary>
        [Property]
        public double Money
        {
            get { return money; }
            set { money = value; }
        }

        /// <summary>
        /// 付款状态
        /// </summary>
        [Property]
        public bool Paystate
        {
            get { return paystate; }
            set { paystate = value; }
        }

        /// <summary>
        /// 付款方式
        /// </summary>
        [Property]
        public PayMethod Paymethod
        {
            get { return paymethod; }
            set { paymethod = value; }
        }

        /// <summary>
        /// 订单ID
        /// </summary>
        [Property]
        public Guid OrderGuid
        {
            get { return orderGuid; }
            set { orderGuid = value; }
        }
    }
}